/**
 * Created by dinghh on 2018/07/12.
 */
angular.module('MetronicApp').controller("RecognitionDetailViewController",
    ['$rootScope', '$scope', '$state', '$stateParams', 'toastr', 'RecognitionDetailService',
        function ($rootScope, $scope, $state, $stateParams, toastr, RecognitionDetailService) {
            $scope.$on('$viewContentLoaded', function () {
                App.initAjax();
                $rootScope.settings.layout.pageBodySolid = true;
                $rootScope.settings.layout.pageSidebarClosed = false;
            });

            $scope.condition = {};
            $scope.areaList = [];
            $scope.id = $stateParams.id;

            //tab页切换
            $scope.tabItemList = [
                {
                    "name": "模型管理",
                    "router": "modelManagementList",
                    "selected": false
                },
                {
                    "name": "污染源数据造假识别",
                    "router": "recognitionDetail",
                    "selected": true
                }
            ];

            //详情
            if ($scope.id) {
                RecognitionDetailService.get($scope.id).$promise.then(function (result) {
                    $scope.company = result.data;
                });
            }

            //返回
            $scope.back = function(){
                $state.go('recognitionDetail');
            };
        }
    ]
);